#ifndef _XYU_H__
#define _XYU_H__


// thread
#include <thread>
#include <mutex>
#include <functional>
#include <condition_variable>
#include <memory>
#include <atomic>

// io
#include <iostream>

// posix
#include <unistd.h>



// STL
#include <unordered_map>
#include <deque>
#include <vector>

#include <cassert>

namespace util
{
//////////////////////////////////////////////////////////////////////////////////
    /* ThreadPool cfg */
	struct Config
    {
        // pool limit
        uint16_t threadMax_ = 16;
        uint16_t threadMin_ = 2;

        // task limit
        uint16_t taskMax_ = 1024;
        uint16_t taskMin_ = 1;

        // runtime cfg
        std::atomic_uint16_t currentThreadSize_;
        std::atomic_uint16_t taskSize_;

        // state
        std::atomic_bool running_;

        Config() : currentThreadSize_(0), taskSize_(0), running_(false) {}

        // non copyable
        Config(const Config&) = delete;
        Config& operator=(const Config&) = delete;
    };

//////////////////////////////////////////////////////////////////////////////////
    /* Result cfg*/
    enum class ResultState
    {
        SUCCESS,
        FAILURE
    };

    
} /* namespace util */

#endif // !